import logging
import HTMLTestRunner_cn

import yagmail






def have_log():
    log=logging.basicConfig(filemode='a+',filename='baidu.log',format='%(message)s--%(filename)s--%(levelname)s--%(asctime)s--%(lineno)d',level=logging.DEBUG)




    return log






def report(suite):
    HTMLTestRunner_cn.HTMLTestRunner(open('baidu.html','wb'),
                                     title='百度搜索测试报告',
                                     description='百度测试数据'

                                     ).run(suite)


def send_mail():
    mail=yagmail.SMTP(user='2101241257@qq.com',password='kbhfmesqqvnabije',host='smtp.qq.com')
    mail.send(to='1299961207@qq.com',subject='鳄鱼皮',contents=['老弟你给我发消息干啥','baidu.log','baidu.html'])
    mail.close()



